import Vue from 'vue'
import Router from 'vue-router'

import UserIndex from '../view/user/index'
import UserShow from '../view/user/show'
import UserAbout from '../view/user/about'
import UserArchives from '../view/user/archives'
import UserTypes from '../view/user/types'
import UserBlog from '../view/user/blog'
import searchBlog from '../view/user/search';
import UserAnime from '../view/user/anime';

import AdminIndex from '../view/admin/index'
import AdminBlogs from '../view/admin/blogs'
import AdminTypes from '../view/admin/types'
import AdminLogin from '../view/admin/login'
import AdminAnimes from '../view/admin/animes'
import inputType from '../view/admin/inputType'
import inputBlog from '../view/admin/inputBlog'
import inputAbout from '../view/admin/inputAbout'
import inputAnime from '../view/admin/inputAnime'

import notFind from '../view/404'

Vue.use(Router)

export default new Router({
    linkActiveClass: 'active',
    routes: [{
        path: '/',
        component: UserIndex,
        children: [{
            path: 'index',
            component: UserShow
        }, {
            path: 'about',
            component: UserAbout
        }, {
            path: 'archives',
            component: UserArchives
        }, {
            path: 'types',
            component: UserTypes,
        }, {
            path: 'blog/:id',
            component: UserBlog,
            props: true
        }, {
            path: 'search',
            component: searchBlog
        }, {
            path: 'anime',
            component: UserAnime
        }, {
            path: "",
            redirect: '/index'
        }]
    }, {
        path: '/admin',
        component: AdminIndex,
        children: [{
            path: 'blogs',
            component: AdminBlogs
        }, {
            path: 'types',
            component: AdminTypes
        }, {
            path: 'animes',
            component: AdminAnimes
        }, {
            path: 'inputType',
            component: inputType
        }, {
            path: 'inputBlog/:id',
            component: inputBlog,
            props: true
        }, {
            path: 'inputAbout',
            component: inputAbout
        }, {
            path: 'inputAnime/:id',
            component: inputAnime,
            props: true
        }, {
            path: '',
            redirect: '/admin/blogs'
        }]
    }, {
        path: '/login',
        component: AdminLogin
    }, {
        path: '/404',
        component: notFind
    }]
})